import socket
import time
import sys

s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)

host = '127.0.0.1'
port = 666

s.connect((host, port))
message = s.recv(1024)

for i in range(10):
    s.sendall(b'hello')
    time.sleep(2)

s.close()

print(message.decode('utf-8'))
